home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 May / CMCD0505.ISO / Software / Demo / DesktopX / objects / Rubicon_meters.dxpack / {648D6717-0AF3-487D-B115-C8D9E62DF9D3}.DXScript2 < prev    next >
Extensible Markup Language  |  2004-01-29  |  2KB  |  76 lines

  1. <?xml version="1.0"?>
  2. <!--DXScript Data File.  Version 2.0-->
  3. <DXScript>
  4.     <Script><![CDATA['Called when the script is executed
  5. Sub Object_OnScriptEnter
  6.     If Object.LocalStorage("position")="in" Then SlideMe
  7.     i=1
  8.         Do Until DesktopX.IsObject("R_M"&i)=False
  9.             If Object.LocalStorage("hidden"&i)="yes" Then
  10.                 DesktopX.Object("R_M"&i).Visible=False
  11.             End If
  12.             i=i+1
  13.         Loop
  14.         Shuffle
  15.         If Object.LocalStorage("position")="in" Then SlideMe
  16. End Sub
  17.  
  18. Sub Object_OnStateChange(state)
  19.     If State = "Command executed" Then
  20.         SlideMe
  21.     End If
  22. End Sub
  23.  
  24. Sub Shuffle
  25.         i=1
  26.         x=12
  27.         Do Until DesktopX.IsObject("R_M"&i)=False
  28.             If DesktopX.Object("R_M"&i).Visible=True Then
  29.                 DesktopX.Object("R_M"&i).Left=x
  30.                 x=x+DesktopX.Object("R_M"&i).Width-1
  31.                 DesktopX.ScriptObject("R_M"&i&"t").Object.State="checked"
  32.                 Object.LocalStorage("hidden"&i)="no"
  33.             Else
  34.                 DesktopX.ScriptObject("R_M"&i&"t").Object.State="unchecked"
  35.                 Object.LocalStorage("hidden"&i)="yes"
  36.             End If
  37.             i=i+1
  38.         Loop
  39.         If x=12 Then 
  40.             x=59
  41.             DesktopX.Object("R_meters_splash").Visible=True
  42.         Else
  43.             DesktopX.Object("R_meters_splash").Visible=False
  44.         End If
  45.         DesktopX.Object("R_metersback").Width=x+10
  46. End Sub
  47.  
  48. Sub SlideMe
  49.         x=Object.Left
  50.     If x=0 Then 
  51.         dx=1
  52.         tx=70    
  53.         Object.LocalStorage("position")="in"
  54.     Else
  55.         dx=-1
  56.         tx=0
  57.         Object.LocalStorage("position")="out"
  58.     End If    
  59.     Do Until x=tx
  60.             x=x+dx
  61.             Object.Left=x
  62.     Loop
  63. End Sub
  64.  
  65. 'Called when the script is terminated
  66. Sub Object_OnScriptExit
  67.     i=1
  68.         Do Until DesktopX.IsObject("R_M"&i)=False
  69.             If DesktopX.Object("R_M"&i).Visible=False Then
  70.                 Object.LocalStorage("hidden"&i)="yes"
  71.             End If
  72.             i=i+1
  73.         Loop
  74. End Sub
  75. ]]></Script><Globals><Editor><PropPane>0</PropPane><EditorLeft>423</EditorLeft><EditorTop>1</EditorTop><EditorRight>1179</EditorRight><EditorBottom>915</EditorBottom></Editor><Object><LanguageCLSID>{B54F3741-5B07-11CF-A4B0-00AA004A55E8}</LanguageCLSID><ControlCLSID>{00000000-0000-0000-0000-000000000000}</ControlCLSID><ControlObjWidth>64</ControlObjWidth><ControlObjHeight>64</ControlObjHeight><RunState>1</RunState><ScriptHostVersion>2</ScriptHostVersion></Object></Globals></DXScript>
  76.